package cn.hyh.core;

import cn.hyh.core.dao.DicsMapper;
import cn.hyh.core.service.ServiceInterface.DicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @auther :hyh
 * @desc :     定时任务
 * @date :2019/7/28
 */
@Component
public class scheduledTask {

    @Autowired
    private DicService dicService;
    // TODO: 2019/7/28 完成自动刷新天数的定时任务。


//    @Scheduled(fixedDelayString = "1000")
    @Scheduled(cron = "0 0 0 1/1 * ? ")
    public  void countRuntimeDays(){
        System.out.println("执行定时任务");
        dicService.addRuntimeDays();
    }
}
